package red.sms.db.config;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Properties;

public class ServiceConfig {
	public static String dau_so = "7x45";
	public static String command_code = "HT";
	public static Properties props = new Properties();
	
	public ServiceConfig() {
		try {
			loadProperties();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
	
	private void loadProperties() throws FileNotFoundException, IOException {
				String fileName = rootConfig.shareInstance().getRoot() + "conf/database.conf";	
				props.load(new FileInputStream(fileName));
				dau_so = props.getProperty("dau_so",dau_so);
				command_code = props.getProperty("command_code", command_code);		
	}
	
	public static boolean checkMaDichVu(String maDichVu) {
		if(dau_so.equalsIgnoreCase(maDichVu)) return true;
		else return false;
	}


	public static boolean checkCommandCode(String commandCode) {
		if(command_code.equalsIgnoreCase(commandCode)) return true;
		else return false;
	}

}
